#include "tcp_server_test.h"
int main(int argc, char *argv[]) {
  sdx::TcpServer sliceEchoServer;
  sliceEchoServer.createSocket();
  sliceEchoServer.bindIp();
  sliceEchoServer.listenData();
  sliceEchoServer.acceptMessage();
  int pipeFd[2];
  pipe(pipeFd);
  splice(sliceEchoServer.getAcceptFd(), NULL, pipeFd[1], NULL, 32768,
         SPLICE_F_MOVE | SPLICE_F_MORE);
  splice(pipeFd[0], NULL, sliceEchoServer.getAcceptFd(), NULL, 32768,
         SPLICE_F_MOVE | SPLICE_F_MORE);
  sliceEchoServer.closeAccept();
  sliceEchoServer.closeSocket();
  return 0;
}